<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * pelamarpengalaman.php
 * @author ranuandra
 *
 * 12 Mar 2012 14:31:18
 *
 * 
 */

class Model_Pelamarpengalaman extends ORM
{
	protected $_belongs_to = array(
		'mstbidang' 		=> array('model' 	=> 'mstbidang'),
		'mstposisi' 		=> array('model' 	=> 'mstposisi'),
		'mstspesialisasi' 	=> array('model' 	=> 'mstspesialisasi'),
		'mstindustri'		=> array('model'	=> 'mstindustri'),
		'mstpelamar'		=> array('model'	=> 'mstpelamar'),
	);
	
	private $_field = array('mstpelamar_id', 'mstbidang_id', 'institusi', 'alamat_institusi', 'cp', 'mstposisi_id', 'mstspesialisasi_id', 'gaji', 'dari_tanggal', 'sampai_tanggal', 'mstindustri_id');
	private $_form = array(
						   'mstpelamar_id' 		=> '', 
						   'mstbidang_id' 		=> '', 
						   'institusi'			=> '', 
						   'alamat_institusi' 	=> '', 
						   'cp' 				=> '',
						   'mstposisi_is' 		=> '',
						   'mstspesialisasi_id' => '',
						   'gaji' 				=> '',
						   'dari_tanggal' 		=> '',
						   'sampai_tanggal' 	=> '',
						   'mstindustri_id'		=> '',
						  );
	
	public function roles()
	{
		return array(
						   'mstpelamar_id' => array(
												array('min_length', array(':value', 0)),
											),
						   'mstbidang_id' => array(
												array('min_length', array(':value', 0)),
											), 
						   'institusi' => array(
												array('min_length', array(':value', 0)),
											), 
						   'alamat_institusi' => array(
												array('min_length', array(':value', 0)),
											),
						   'cp' => array(
												array('min_length', array(':value', 0)),
											),
						   'mstposisi_id' 	=> array(
												array('min_length', array(':value', 0)),
											),
						   'mstspesialisasi_id' => array(
												array('min_length', array(':value', 0)),
											),
						   'gaji' => array(
												array('min_length', array(':value', 0)),
											),
						   'dari_tanggal' => array(
												array('min_length', array(':value', 0)),
											),
						   'sampai_tanggal' => array(
												array('min_length', array(':value', 0)),
											),
						   'mstindustri_id' => array(
												array('min_length', array(':value', 0)),
											),
		
		); 
	}
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}	
}